#pragma once

#include "CogProduction.h"
#include "CogProcessors.h"

#pragma warning(disable : 4996) // for strcpy

// ------------------------------------------------------------------------------------------

// ant movement ops
#define OP_MOVE			40
#define OP_LEFT			41
#define OP_RIGHT		42
#define OP_IFFOODAHEAD	43
#define OP_PROG			44

// -------------------

class SFAntState
{
public:
	SFAntState();

	void update(int action);
	static void computeMoveCoord(int dir, int& X, int& Y);

	// data:
	char world[32][33];
	char nextCell;
    int antX, antY, antDirection, collectedFood, maxFood, countdown;

	// constants:
	static const int ANT_MOVE = 0;
	static const int ANT_RIGHT = 1;
	static const int ANT_LEFT = 2;
	static const int ANT_SLEEP = 3;
};

// -------------------

class CogAntEvaluator : public CogEvaluator
{
public:
	CogAntEvaluator();

	double evaluate(CogProduction* pRule);
	void reset();
	
protected:
	void compute(vector<CogSymbol>& symbols, size_t index);

	boost::thread_specific_ptr<SFAntState> antState;
};

// ------------------------------------------------------------------------------------------